#include <iostream>
using namespace std;

//只能利用全局函数重载左移运算符

class Person {
    friend ostream& operator<<(ostream & out , const Person & p);
public:
    Person(int a , int b) {
        M_A = a;
        M_B = b;
    }

private:
    int M_A;
    int M_B;
};

ostream& operator<<(ostream & out , const Person & p) {
    out << "M_A = " << p.M_A << endl;
    out << "M_B = " << p.M_B << endl;
    return out;
}

void test01() {
    Person p1(10 , 20);
    //p1.M_A = 10;
    //p1.M_B = 20;

    cout << p1;
}

int main() {
    test01();
    return 0;
}